package org.delphy.indy2.controls
{
	import mx.controls.ComboBox;
	import mx.core.ClassFactory;
	
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	
	import org.delphy.indy2.controls.carbonComboBoxClasses.*;

	public class CarbonComboBox extends ComboBox
	{
		[Bindable]
		public var glowColor:Number;
		
		[Bindable]
		public var glowSize:Number;
		
		public function CarbonComboBox()
		{
			super();
			
			styleName="carbonComboBox";
			dropdownFactory=new ClassFactory(CarbonComboBoxDropdown);
			addEventListener(MouseEvent.ROLL_OVER,onRollOver);
			addEventListener(MouseEvent.ROLL_OUT,onRollOut);				
		}
		private function onRollOver(evt:MouseEvent):void{
			if(editable)
				return;
				
			glowColor=getStyle("glowColor");
			glowSize=getStyle("glowSize");
			
			var glowFilter:GlowFilter=new GlowFilter();
			glowFilter.blurX=glowSize;
			glowFilter.blurY=glowSize;
			glowFilter.alpha=0.75;
			glowFilter.color=glowColor;
			
			filters=[glowFilter];
		}
		private function onRollOut(evt:MouseEvent):void{
			if(editable)
				return;
				
			filters=[];
		}	

	}
}